package HLLibClasses;

import HLCode.HLClassManager;
import HLCode.HLLibClass;
import HLCode.HLObject;
import HLLib.base.HLByteList;
import HLLib.base.HLString;
import HLLib.userControl.HLBase64;

public class HLClassBase64 extends HLLibClass {
    public HLClassBase64(HLClassManager owner) {
        super(owner);
    }

    public HLObject NewObject() {
        return new HLBase64();
    }

    public void StaticExecute(int index, HLObject args, HLObject resultOwnerObject, int resultIndex) {
        switch (index) {
        case 0: {
            if (resultOwnerObject == null) {
                HLBase64.encode((HLByteList)args.GetObject(0));
            } else {
                resultOwnerObject.SetObject(resultIndex, HLBase64.encode((HLByteList)args.GetObject(0)));
            }
            break;
        }
        case 1: {
            if (resultOwnerObject == null) {
                HLBase64.decode((HLString)args.GetObject(0));
            } else {
                resultOwnerObject.SetObject(resultIndex, HLBase64.decode((HLString)args.GetObject(0)));
            }
            break;
        }
        case 2: {
            if (resultOwnerObject == null) {
                HLBase64.encodeEx((HLByteList)args.GetObject(0), args.GetBoolean(0), args.GetBoolean(1));
            } else {
                resultOwnerObject.SetObject(resultIndex, HLBase64.encodeEx((HLByteList)args.GetObject(0), args.GetBoolean(0), args.GetBoolean(1)));
            }
            break;
        }
        case 3: {
            if (resultOwnerObject == null) {
                HLBase64.decodeEx((HLString)args.GetObject(0), args.GetBoolean(0), args.GetBoolean(1));
            } else {
                resultOwnerObject.SetObject(resultIndex, HLBase64.decodeEx((HLString)args.GetObject(0), args.GetBoolean(0), args.GetBoolean(1)));
            }
            break;
        }
        case 4: {
            if (resultOwnerObject == null) {
                HLBase64.UrlEncode((HLString)args.GetObject(0));
            } else {
                resultOwnerObject.SetObject(resultIndex, HLBase64.UrlEncode((HLString)args.GetObject(0)));
            }
            break;
        }
        case 5: {
            if (resultOwnerObject == null) {
                HLBase64.UrlDecode((HLString)args.GetObject(0));
            } else {
                resultOwnerObject.SetObject(resultIndex, HLBase64.UrlDecode((HLString)args.GetObject(0)));
            }
            break;
        }
        case 6: {
            HLBase64.test();
            break;
        }
        }
    }
}
